cmake_minimum_required(VERSION 3.14)
project(plantRobot)

set(CMAKE_CXX_STANDARD 14)
#set(QT_CMAKE_DIR /opt/qt5/5.12.3/gcc_64)

set(CMAKE_AUTOMOC on)
set(CMAKE_AUTOUIC on)
set(CMAKE_AUTORCC on)
set(CMAKE_INCLUDE_CURRENT_DIR on)

set(INC_DIR include)
set(LIB_DIR lib/x64)

include_directories(${INC_DIR})
link_directories(${LIB_DIR})

find_package(Qt5 COMPONENTS Widgets Sql Core)

add_executable(plantRobot
#        src/view/voicemain.cpp

        src/view/MyVoice.cpp
        src/view/MyVoice.h

        src/view/MyPcm.cpp
        src/view/MyPcm.h

        src/utils/MyTimeHelper.h

        src/utils/DBHelper.cpp
        src/utils/DBHelper.h

        src/view/main.cpp

        src/view/InitMainWindow.cpp
        src/view/InitMainWindow.h

        src/view/TabWidget.cpp
        src/view/TabWidget.h

        src/model/User.cpp
        src/model/User.h

        src/dao/UserDao.cpp
        src/dao/UserDao.h

        src/view/MainForm.cpp
        src/view/MainForm.h

        src/view/LoginWidget.cpp
        src/view/LoginWidget.h

        src/model/Plants.cpp
        src/model/Plants.h

        src/dao/PlantsDao.cpp
        src/dao/PlantsDao.h

        src/utils/BitBuffer.h
        src/utils/BitBuffer.cpp

        src/utils/QrCode.h
        src/utils/QrCode.cpp

        src/utils/QrSegment.h
        src/utils/QrSegment.cpp
        src/view/ShowCode.cpp
        src/view/ShowCode.h)
#target_link_libraries相当于在gcc编译命令中使用-l链接外部库
target_link_libraries(plantRobot
        Qt5::Core Qt5::Sql Qt5::Widgets
        pthread wiringPi
        asound libmsc.so
        ${CMAKE_DL_LIBS})